home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swagd_f.zip
/
DIRS.SWG
/
0002_Search ALL Dirs and Subs.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-05-28
|
769b
|
29 lines
Uses Crt, Dos, WinDos;
Procedure SearchSubDirs(Dir:PathStr;Target:SearchRec);
Var
FoundDir: TSearchRec;
FileSpec: PathStr;
Path : DirStr;
DummyName: NameStr;
DummyExt : ExtStr;
begin
If KeyPressed then Repeat Until KeyPressed;
FileSpec:= Dir + '*.';
FindFirst('*.*', AnyFile, FoundDir);
While (DosError = 0) do
begin
With FoundDir do
begin
If Name[1] <> '.' then
if Directory and Attr <> 0 then
begin
FSplit(FileSpec,Path,DummyName,DummyExt);
FindFirst(Path + Name + '\' ,Target);
end;
end; {with FoundDir}
if KeyPressed then Pause;
FindNext(FoundDir);
end; {read loop}
If DosError <> 18 then DosErrorExit;
end;